package cn.net.xyan.easy.webapp.base.service.convert;

import cn.net.xyan.easy.webapp.base.api.dto.QueryWebModuleRsq;
import cn.net.xyan.easy.webapp.base.entity.WebModule;
import cn.net.xyan.easy.webapp.base.service.IEntityResponseConvert;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Created by zarra on 16/2/23.
 */
@Component
public class WebModuleRspConvert implements IEntityResponseConvert<QueryWebModuleRsq,WebModule> {
    @Override
    public boolean needContext() {
        return false;
    }

    @Override
    public QueryWebModuleRsq convert(WebModule wm, Map<String, Object> context) {
        QueryWebModuleRsq rsp = new QueryWebModuleRsq();
        rsp.setName(wm.getName());
        rsp.setTitle(wm.getTitle());
        rsp.setUrl(wm.getUrl());
        return rsp;
    }
}
